package org.example.test1.newcontroller;

import org.example.test1.newservice.QueryService;
import org.example.test1.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/brand")

public class QueryController {
    @Autowired
    private QueryService testservice;
    @GetMapping("/{id}")
    public Result selectOne(@PathVariable int id){
        return Result.success(testservice.select(id));
    }

    @GetMapping
    public Result selectAll(){
        return Result.success(testservice.selectAll());
    }

}
